<?php
/**
 * User's wire posts
 * 
 */

$owner = elgg_get_page_owner_entity();
if (!$owner) {
	forward('rsactivity/all');
}

$title = elgg_echo('rsactivity:user', array($owner->name));

//elgg_push_breadcrumb(elgg_echo('rsactivity'), "rsactivity/all");
//elgg_push_breadcrumb($owner->name);

$context = '';
if (elgg_get_logged_in_user_guid() == $owner->guid) {
	$form_vars = array('class' => 'rsactivity-form');
	$content = elgg_view_form('rsactivity/add', $form_vars);
	$content .= elgg_view('input/urlshortener');
	$context = 'mine';
}

$content .= elgg_list_entities(array(
	'type' => 'object',
	'subtype' => 'rsactivity',
	'owner_guid' => $owner->guid,
	'limit' => 15,
));

elgg_unregister_menu_item('extras','rss');

$body = elgg_view_layout('content', array(
	'filter_context' => $context,
	'content' => $content,
	'title' => $title,
));

echo elgg_view_page($title, $body, 'rs_everyone');
